/**
 * 
 */
package com.nars.date;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

/**
 * @author Student
 * 
 */
public class ParsingDate {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		String dateString = "03/11/06";
		String dateString2 = "06";
		SimpleDateFormat format = new SimpleDateFormat("MM/dd/yy");
		SimpleDateFormat format2 = new SimpleDateFormat("MM");
		try {
			Date date = format.parse(dateString);
			Date date2 = format2.parse(dateString2);
			System.out.println("Parsed date: " + date);
			System.out.println("Parsed date: " + new Date());
			System.out.println("Parsed date: " + date2);
		} catch (ParseException pe) {
			System.out.println("Could not parse date!");
		}
	}
}
